#ifndef HOOKHANDLER_H
#define HOOKHANDLER_H

#include <windows.h>
#include <QObject>

class HookHandler : public QObject
{
    Q_OBJECT

public:
    explicit HookHandler(QObject *parent = nullptr);
    ~HookHandler();

    static HookHandler *instance();

    void installHook();
    void uninstallHook();

signals:
    void mouseMoved(int x, int y);

private:
    HHOOK mouseHook;
    static LRESULT CALLBACK mouseProc(int nCode, WPARAM wParam, LPARAM lParam);

private:
    static HookHandler *m_instance;
};

#endif // HOOKHANDLER_H
